import { PropsWithChildren } from "react";
import { Colors, lightColors } from "./colors";
import { ColorValue, PressableProps } from "react-native";



export type StringOmit<K extends string> = K | Omit<string, K>;


export type ThemedProps<T> = T & {
    theme?: Theme;
};

export type ThemedPropsWithChildren<T> = PropsWithChildren<ThemedProps<T>>;

export type RneFunctionComponent<T> = React.FunctionComponent<
    ThemedPropsWithChildren<T>
>;

export interface ThemeSpacing {
    xs: number;
    sm: number;
    md: number;
    lg: number;
    xl: number;
}

export const defaultSpacing = { xs: 2, sm: 4, md: 8, lg: 12, xl: 24 };

export const defaultTheme: Theme = {
    colors: lightColors,
    spacing: defaultSpacing,
};

export type Theme = {
    colors: Colors;
    spacing: ThemeSpacing;
};

export const androidRipple = (
    rippleColor?: string | ColorValue
  ): PressableProps['android_ripple'] => {
    return {
      borderless: false,
      color: rippleColor,
      radius: -5,
    };
  };